package com.heima.service.impl;

import com.github.pagehelper.PageHelper;
import com.heima.dao.IProductDao;
import com.heima.domain.Product;
import com.heima.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ProductServiceImpl implements IProductService {
    @Autowired
    private IProductDao dao;
    @Override
    public List<Product> findAll(Integer page,Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        return dao.findAll();
    }

    @Override
    public void save(Product product) {
        dao.save(product);
    }

    @Override
    public void deleteById(String id) {
        dao.deleteById(id);
    }
}
